@echo off
setlocal enabledelayedexpansion
set TPC=C:\compilers\tp7\BIN\TPC.EXE
set BCPP=C:\compilers\BCC55\
set TASMDIR=C:\compilers\TASM\BIN\

if /I "%~x1" == ".pas"  (
	if exist %~dps1%~ns1.exe (
		del %~dps1%~ns1.exe
	)
	cd %~dps1 
	@echo on
	%TPC% %~s1 -$L- -$D- 
	@echo off
	if "%2"=="-exec" (
		@echo on
		%~dps1%~ns1.exe
		@echo off
	)
) else if /I "%~x1" == ".asm" (
	if exist %~dps1%~ns1.exe (
		del %~dps1%~ns1.exe
	)
	cd %TASMDIR%
	if /I "%3"=="-i32" (
		@echo on
		TASM32 -I%~dps1 %~s1, %~dps1%~ns1.obj
		tlink32 %~dps1%~ns1.obj, %~dps1%~ns1.exe,,C:\compiler\TASM\Lib\import32.lib
		@echo off
	) else (
		@echo on
		TASM -I%~dps1 %~s1, %~dps1%~ns1.obj
		TLINK %~dps1%~ns1.obj, %~dps1%~ns1.exe
		@echo off
	)
	if /I "%2"=="-exec" (
		@echo on
		%~dps1%~ns1.exe
		@echo off
	)
) else if /I "%~x1" == ".cpp" (
	if exist %~dps1%~ns1.exe (
		del %~dps1%~ns1.exe
	)
	cd %BCPP%Bin
	@echo on
	bcc32.exe -I..\Include -L..\Lib -n%~dps1 -v- %~s1
	@echo off
	if /I "%2"=="-exec" (
		@echo on
		%~dps1%~ns1.exe
		@echo off
	)
) else if /I "%~x1" == ".c" (
	if exist %~dps1%~ns1.exe (
		del %~dps1%~ns1.exe
	)
	cd %BCPP%Bin
	@echo on
	bcc32.exe  -I..\Include -L..\Lib -n%~dps1 -v- %~s1
	@echo off
	if  /I "%2"=="-exec" (
		@echo on
		%~dps1%~ns1.exe
		@echo off
	)
) else if /I "%~x1" == ".go" (
	cd %~dps1
	@echo on
	%GOBIN%/8g %~ns1.go
	%GOBIN%/8l -o %~ns1.exe %~ns1.8 
	@echo off
	if  /I "%2"=="-exec" (
		@echo on
		%~ns1.exe
		@echo off
	)
)
echo.
pause